
export function getUrlParam(name){//判断公众号截取code
  var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
  let url = window.location.href.split('#')[0]
  let search = url.split('?')[1]
  console.log(search)
  if (search) {
    var r = search.substr(0).match(reg)
    if (r !== null)
      return unescape(r[2])
    return null
  } else
    return null

}
